package com.jt.www.domain.enums.wxb;

import org.apache.commons.lang3.StringUtils;

/**
 * 营销模式 1-内部人员推广，2-非教育专属营销员，3-教育专属营销员
 */
public enum MarketModelEnum {

    INSIDER("01", "内部人员推广"),
    NON_EXCLUSIVE("02", "非教育专属营销员"),
    EXCLUSIVE("03", "教育专属营销员");

    /**
     * 模式
     */
    private String model;

    /**
     * 描述
     */
    private String desc;


    MarketModelEnum(String model, String desc) {
        this.model = model;
        this.desc = desc;
    }

    public static String getModelByChannelCode(String channelCode) {
        if (StringUtils.isBlank(channelCode)) {
            return INSIDER.model;
        }
        //教育在私保的渠道编码A02
        if (channelCode.equals("A02")) {
            return EXCLUSIVE.model;
        }
        return NON_EXCLUSIVE.model;
    }

    public static String getDescByModel(String model) {
        if (StringUtils.isBlank(model)) {
            return "";
        }
        for (MarketModelEnum marketModelEnum : MarketModelEnum.values()) {
            if (marketModelEnum.model.equals(model)) {
                return marketModelEnum.desc;
            }
        }
        return "";
    }


    public String getModel() {
        return model;
    }

    public String getDesc() {
        return desc;
    }
}


